﻿<controls:ChildWindow xmlns:my1="clr-namespace:VAdvantage.Panels"  x:Class="VAdvantage.Framework.Find"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" Title="Find" 
                      mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="458" 
                      Width="821" xmlns:my="clr-namespace:VAdvantage.Controls" 
                      xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
                    
                      Closing="ChildWindow_Closing" Loaded="ChildWindow_Loaded" KeyDown="ChildWindow_KeyDown">
    <Grid x:Name="LayoutRoot" Margin="2" Height="432">
        <Grid.Resources>
            <!--<converter:BoolInverter x:Key="boolInverter"/>-->
        </Grid.Resources>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="542*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        <my:VTabControl x:Name="vtabLookup" Margin="0,6,2,0" SelectionChanged="vTabControl1_SelectionChanged" Height="381" VerticalAlignment="Top">
            <controls:TabItem Header="LookupRecords" Name="tabLookupRecords">
                <Grid Background="Transparent">
                    <Grid.ColumnDefinitions>
                        
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                        
                    </Grid.RowDefinitions>

                    <ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden">
                    <Grid x:Name="tblpnlS" Background="Transparent">
                        <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="2*" />
                        <ColumnDefinition Width="304" />
                        <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            
                        </Grid.RowDefinitions>

                    <my:VTextBox Grid.Column="1" Height="23" Margin="3" x:Name="vtxtDocNo" VerticalAlignment="Center"   Text="%" TabIndex="0" />
                    <my:VTextBox Grid.Column="1" Grid.Row="1" Height="23" x:Name="vtxtSearchKey" VerticalAlignment="Center"  Margin="3" Text="%" TabIndex="1" />
                    <my:VTextBox Grid.Column="1" Grid.Row="2" Height="23" Margin="3" x:Name="vtxtName" VerticalAlignment="Center"   Text="%" TabIndex="3" />
                    <my:VTextBox Grid.Column="1" Grid.Row="3" Height="23" Margin="3" x:Name="vtxtDesc" VerticalAlignment="Center"  Text="%" TabIndex="4" />
                            <my:VLabel   Grid.Column="0" Grid.Row="0" HorizontalAlignment="Right" Margin="3" x:Name="vlblDocNo" VerticalAlignment="Center" Content="Document No"  />
                            <my:VLabel Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" Margin="3" x:Name="vlblSearchKey" VerticalAlignment="Center" Content="Search Key"  />
                            <my:VLabel Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" Margin="3" x:Name="vlblName" VerticalAlignment="Center" Content="Name"  />
                            <my:VLabel Grid.Column="0" Grid.Row="3" HorizontalAlignment="Right" Margin="3" x:Name="vlblDesc" VerticalAlignment="Center" Content="Description"   />
                    </Grid>
</ScrollViewer>
                   
                    <Button Height="35" HorizontalAlignment="Right" Margin="0,0,40,2" Name="ibtnCancelS" VerticalAlignment="Bottom" Width="35" Grid.Row="1" Click="ibtnCancelS_Click" >
                        <Image Stretch="Fill" Source="/VAdvantage;component/Images/cancel_up.png" ImageFailed="Image_ImageFailed" />
                    </Button>
                    <Button Height="35" Margin="0,0,2,2" HorizontalAlignment="Right" Name="ibtnOKS" VerticalAlignment="Bottom" Width="35" Grid.Row="1" Click="ibtnOKS_Click" >
                        <Image Stretch="Fill"  Source="/VAdvantage;component/Images/right_up.png" />
                    </Button>
                    <Button Height="35" HorizontalAlignment="Left" Name="ibtnNewRec" VerticalAlignment="Bottom" Width="35" Grid.Row="1" Margin="2" Click="ibtnNewRec_Click">
                        <Image Stretch="Fill" Source="/VAdvantage;component/Images/Toolbar/New32.png"  />
                    </Button>
                </Grid>
            </controls:TabItem>
            <controls:TabItem Header="Advance" Name="tabAdvance">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="40" />
                    </Grid.RowDefinitions>
                    <Grid Name="tblpnlA" Background="Transparent">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="125" />
                        <ColumnDefinition Width="125" />
                        <ColumnDefinition Width="140" />
                        <ColumnDefinition MinWidth="155" Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <my:VLabel Grid.Row="0" Grid.Column="0" Margin="3" HorizontalAlignment="Right" x:Name="vlblQueryName" VerticalAlignment="Center" Content="Query Name" />
                    <my:VTextBox Grid.Column="1" Grid.Row="0" Margin="3" Height="23"  x:Name="vtxtQueryName" VerticalAlignment="Stretch" TabIndex="5" />
                    <my:VLabel Grid.Column="2" Margin="3" Grid.Row="0" HorizontalAlignment="Right"  x:Name="vlblSelectQuery" VerticalAlignment="Center" Content="Get Saved Query"  />
                    <my:VComboBox Grid.Column="3" Margin="3" Height="23" HorizontalAlignment="Stretch"  x:Name="vcmbQueryA" VerticalAlignment="Stretch" SelectionChanged="vcmbQueryA_SelectionChanged" TabIndex="6" />
                   
                   
                    <Button Margin="3" HorizontalAlignment="Left" Name="ibtnDelQuery" Grid.Column="4" Height="25" VerticalAlignment="Center" Width="25" Click="ibtnDelQuery_Click">
                        <Image  Stretch="Fill" Source="/VAdvantage;component/Images/delete.png"></Image>
                    </Button>

                    <my:VLabel Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" x:Name="vlblColName" VerticalAlignment="Bottom" Content="Column" />
                    <my:VLabel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center"  x:Name="vlblOperator" VerticalAlignment="Bottom" Content="Operator"  />
                    <my:VLabel Grid.Row="1" Grid.Column="2" HorizontalAlignment="Center"  x:Name="vlblValue" VerticalAlignment="Bottom" Content="Query Value"  />
                    <my:VLabel Grid.Row="1" Grid.Column="3" HorizontalAlignment="Center" x:Name="vlblValue2" VerticalAlignment="Bottom" Content="To Query Value" />

                    <my:VComboBox Margin="3" Grid.Row="2" Grid.Column="0" Height="23" x:Name="vcmbColumn"   SelectionChanged="vcmbColumn_SelectionChanged" />
                    <my:VComboBox Margin="3" Grid.Column="1" Grid.Row="2" Height="23" x:Name="vcmbOperator"  SelectionChanged="vcmbOperator_SelectionChanged" />
                    
                    <!--<my:VTextBox Grid.Column="3" Grid.Row="2" Height="23"  x:Name="txtQueryValue"  FontFamily="Arial" />-->

                    <Button Margin="3" Grid.Row="2" Grid.Column="4" Height="25" Name="ibtnSaveRow" Width="25" Click="ibtnSaveRow_Clcik" HorizontalAlignment="Left">
                        <Image  Stretch="Fill" Source="/VAdvantage;component/Images/save.png" />
                    </Button>

                    <CheckBox Visibility="Collapsed" x:Name="chkDynamic" VerticalAlignment="Center" Checked="chkDynamic_CheckedChanged" Unchecked="chkDynamic_CheckedChanged" Content="IsDynamic" Grid.Row="3" Grid.Column="1" Margin="2"></CheckBox>
                    <my:VComboBox Visibility="Collapsed" x:Name="cmbDymamicOp" Height="23" Grid.Column="2" Grid.Row="3" Margin="3" IsEnabled="{Binding Path=IsChecked, ElementName=chkDynamic}"></my:VComboBox>
                    <my1:DatePanel Visibility="Collapsed" x:Name="cmbDymamicValue" HorizontalAlignment="Left" Height="23" Grid.ColumnSpan="1" Grid.Column="3" Grid.Row="3" Margin="2"  IsEnabled="{Binding Path=IsChecked, ElementName=chkDynamic}" />
                   
                    
                    <sdk:DataGrid AutoGenerateColumns="False"  Grid.Row="4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  Margin="2" Name="vdgvQuery" Background="Silver" Grid.ColumnSpan="5" Unloaded="vdgvQuery_Unloaded">

                    </sdk:DataGrid>
                    
                </Grid>
                <Grid Grid.Row="1" >
                    <Button Grid.Row="5" Height="35" HorizontalAlignment="Left" Margin="2" Name="ibtnRequery" VerticalAlignment="Bottom" Width="35" Click="ibtnRequery_Click">
                        <Image Stretch="Fill"  Source="/VAdvantage;component/Images/refresh32.png"  />
                    </Button >
                    <Button Grid.Column="5" Grid.Row="5" Height="35" HorizontalAlignment="Right" Margin="2,2,40,2" Name="ibtnCancelA"  VerticalAlignment="Bottom" Width="35" Click="ibtnCancelA_Click">
                        <Image Stretch="Fill" Source="/VAdvantage;component/Images/cancel_up.png"  />
                    </Button>
                    <Button Grid.Column="5" Grid.Row="5" Height="35" HorizontalAlignment="Right" Margin="2" Name="ibtnOKA" VerticalAlignment="Bottom" Width="35" Click="ibtnOKA_Click" >
                        <Image  Stretch="Fill" Source="/VAdvantage;component/Images/right_up.png"  />
                    </Button>
                </Grid>
                </Grid>
            </controls:TabItem>
            <sdk:TabItem Header="View" Loaded="TabItem_Loaded">
                        <Grid Name="grid1" Margin="1,1,1,1" Background="Transparent" Height="347" Visibility="Visible" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="111*" />
                        <ColumnDefinition Width="218*" />
                        <ColumnDefinition Width="107*" />
                        <ColumnDefinition Width="229*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="37*" />
                        <RowDefinition Height="37*" />
                        <RowDefinition Height="85*" />
                        <RowDefinition Height="38*" />
                        <RowDefinition Height="38*" />
                        <RowDefinition Height="37*" />
                        <RowDefinition Height="67*" />
                    </Grid.RowDefinitions>
                    <sdk:Label Height="18" HorizontalAlignment="Left" Margin="18,13,0,0" Name="lblName" VerticalAlignment="Top" Width="44" Content="Name" />
            <TextBox Height="23" Margin="5,9,12,0" Name="txtName" VerticalAlignment="Center" Grid.Column="1" TabIndex="7" />
            <sdk:Label Content="Title" Height="18" HorizontalAlignment="Left" Margin="11,14,0,0" Name="lblTitle" VerticalAlignment="Top" Width="44" Grid.Column="2" />
            <TextBox Height="23" Margin="8,10,17,0" Name="txtTitle" VerticalAlignment="Center" Grid.Column="3" TabIndex="8" />
            <sdk:Label Content="Description" Height="18" HorizontalAlignment="Left" Margin="18,9,0,10" Name="lblDescription" VerticalAlignment="Center" Width="68" Grid.Row="1" />
            <TextBox Height="23" Margin="5,3,18,0" Name="txtDescription" VerticalAlignment="Center" Grid.Row="1" Grid.ColumnSpan="3" Grid.Column="1" TabIndex="9" />
            <sdk:Label Content="Available" Height="18" HorizontalAlignment="Left" Margin="18,5,0,0" Name="lblAvailable" VerticalAlignment="Top" Width="68" Grid.Row="2" />
            <ListBox Height="80" Margin="5,5,16,0" Name="lstAvailabelCols" VerticalAlignment="Top" Grid.Row="2" Grid.Column="1" TabIndex="10" />
            <sdk:Label Content="Selected" Height="18" HorizontalAlignment="Left" Margin="11,5,0,0" Name="lblSelected" VerticalAlignment="Top" Width="68" Grid.Row="2" Grid.Column="2" />
            <ListBox Height="80" Margin="8,5,17,0" Name="lstSelectedCols" VerticalAlignment="Top" Grid.Row="2" Grid.Column="3" />
            <sdk:Label Content="Min Value" Height="18" HorizontalAlignment="Left" Margin="21,13,0,0" Name="lblMinValue" VerticalAlignment="Top" Width="64" Grid.Row="4" />
            <my:VNumTextBox Height="23" Margin="4,3,17,0" x:Name="txtMinValue" VerticalAlignment="Center" Grid.Row="4" Grid.Column="1" Text="0" TabIndex="12" />
            <sdk:Label Content="Max Value" Height="18" Margin="11,12,0,0" Name="lblMaxValue" VerticalAlignment="Top" HorizontalAlignment="Left" Width="98" Grid.Row="4" Grid.ColumnSpan="2" Grid.Column="2" />
            <my:VNumTextBox Height="23" Margin="7,3,19,0" x:Name="txtMaxValue" VerticalAlignment="Center" Grid.Row="4" Grid.Column="3" TabIndex="13" />
            <sdk:Label Content="Search" Height="18" HorizontalAlignment="Left" Margin="21,14,0,0" Name="lblSearchQuery" VerticalAlignment="Top" Width="44" Grid.Row="3" />
            <my:VComboBox Height="23" Margin="4,5,0,0" x:Name="cmbSavedQuery" VerticalAlignment="Center" HorizontalAlignment="Left" Width="197" SelectionChanged="cmbSavedQuery_SelectionChanged" Grid.Row="3" Grid.Column="1" TabIndex="11" />
            <sdk:Label Content="BG Color" Height="18" Margin="21,8,0,0" Name="lblBGColor" VerticalAlignment="Top" HorizontalAlignment="Left" Width="64" Grid.Row="5" />
            <my:VComboBox Height="23" Margin="4,4,17,0" x:Name="cmbBGColor" VerticalAlignment="Center" SelectionChanged="cmbBGColor_SelectionChanged" Grid.Row="5" Grid.Column="1" TabIndex="14" />
                    <sdk:Label Content="Header BG Color" Height="18" HorizontalAlignment="Left" Margin="10,9,0,0" Name="lblHeaderBGColor" VerticalAlignment="Top" Width="98" Grid.Row="5" Grid.ColumnSpan="2" Grid.Column="2" />
            <my:VComboBox Height="23" Margin="7,3,19,0" x:Name="cmbHeaderBGColor" VerticalAlignment="Center" SelectionChanged="cmbHeaderBGColor_SelectionChanged" Grid.Row="5" Grid.Column="3" TabIndex="15" />
            <Button Content="&gt;&gt;" Height="23" HorizontalAlignment="Left" Margin="11,33,0,0" Name="btnMoveRight" VerticalAlignment="Top" Width="81" Click="btnMoveRight_Click" Grid.Row="2" Grid.Column="2" />
            <Button Content="&lt;&lt;" Height="23" HorizontalAlignment="Left" Margin="11,62,0,0" Name="btnMoveLeft" VerticalAlignment="Top" Width="82" Click="btnMoveLeft_Click" Grid.Row="2" Grid.Column="2" />
                    <Button Height="35" Margin="0,0,61,6" HorizontalAlignment="Right" Name="btnCancelFrame" VerticalAlignment="Bottom" Width="35" Grid.Row="6" Grid.Column="3" Click="btnCancelFrame_Click" >
                        <Image Stretch="Fill"  Source="/VAdvantage;component/Images/cancel_up.png" />
                    </Button>

                    <Button Height="35" Margin="0,0,20,6" HorizontalAlignment="Right" Name="btnSaveFrame" Click="btnSaveFrame_Click" VerticalAlignment="Bottom" Width="35" Grid.Row="6" Grid.Column="3">
                        <Image Stretch="Fill"  Source="/VAdvantage;component/Images/right_up.png" />
                    </Button>
                </Grid>



            </sdk:TabItem>

            <sdk:TabItem Header="View Access" Name="tabItem2">
                <Grid Name="accessGrid" Background="Transparent">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="48" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="188*" />
                        <ColumnDefinition Width="150*" />
                        <ColumnDefinition Width="157*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25*" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="179*" />
                    </Grid.RowDefinitions>
                    <RadioButton Content="Personal" Grid.Column="1" Grid.Row="1" Height="19" HorizontalAlignment="Left" Margin="9,7,0,0" Name="rdPersonal" VerticalAlignment="Top" Width="99" GroupName="Always" IsChecked="True" Checked="rdPersonal_Checked" />
                    <RadioButton Content="Selected User" Grid.Column="2" Grid.Row="1" Height="24" HorizontalAlignment="Left" Margin="10,7,0,0" Name="rdUser" VerticalAlignment="Top" Width="169" Checked="rdUser_Checked" />
                    <RadioButton Content="Selected Role" Grid.Column="3" Grid.Row="1" Height="22" HorizontalAlignment="Left" Margin="8,7,0,0" Name="rdRole" VerticalAlignment="Top" Width="272" Grid.ColumnSpan="2" Checked="rdRole_Checked" />
                    <my:VComboBox Grid.Column="2" Grid.Row="3" Height="23" Margin="2" x:Name="cmbUser" VerticalAlignment="Top" TabIndex="17" />
                    <my:VComboBox Grid.Column="2" Grid.Row="2" Height="23" Margin="2" x:Name="cmbFrame" VerticalAlignment="Top" SelectionChanged="cmbFrame_SelectionChanged" TabIndex="16" />
                    <my:VComboBox Grid.Column="2" Grid.Row="4" Height="23" Margin="2" x:Name="cmbRole" VerticalAlignment="Top" TabIndex="18" />
                    <sdk:Label Grid.Column="1" Grid.Row="2" Height="20" HorizontalAlignment="Left" Margin="9,2,0,0" Name="label1" VerticalAlignment="Top" Width="97" Content="View" />
                    <sdk:Label Grid.Column="1" Grid.Row="4" Height="19" HorizontalAlignment="Left" Margin="9,2,0,0" Name="lblRole" VerticalAlignment="Top" Width="90" Content="Role" />
                    <sdk:Label Grid.Column="1" Grid.Row="3" Height="21" HorizontalAlignment="Left" Margin="9,2,0,0" Name="lblUser" VerticalAlignment="Top" Width="101" Content="User" />
                    <sdk:DataGrid AutoGenerateColumns="False" Background="Silver" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" Margin="9,0,6,6" Name="vgridAcess" VerticalAlignment="Stretch" Grid.Row="5" Grid.Column="1" />
                    <Button Grid.Column="3" Grid.Row="4" Height="25" Width="25" Margin="13,3,110,0" Name="bAdd" VerticalAlignment="Top" Click="bAdd1_Click" TabIndex="19" >
                        <Image x:Name="AddImage2" Source="/VAdvantage;component/Images/save.png"></Image>
                    </Button>
                    <Button Height="25" Width="25" Margin="13,3,110,0" Name="bAdd1" VerticalAlignment="Top" Grid.Column="3" Grid.Row="3" Click="bAdd1_Click" TabIndex="19" >
                        <Image x:Name="AddImage1" Source="/VAdvantage;component/Images/save.png" ></Image>
                    </Button>
                </Grid>
            </sdk:TabItem>

            <sdk:TabItem Header="KPI" Name="tabItem1">
                <Grid Height="340" Width="671" Margin="1" Background="Transparent">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="38*" />
                        <RowDefinition Height="38*" />
                        <RowDefinition Height="38*" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="38*" />
                        <RowDefinition Height="166*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="110*" />
                        <ColumnDefinition Width="207*" />
                        <ColumnDefinition Width="110*" />
                        <ColumnDefinition Width="240*" />
                    </Grid.ColumnDefinitions>
                    <sdk:Label Height="16" HorizontalAlignment="Left" Margin="20,13,0,0" Name="lblSearchKey" VerticalAlignment="Top" Width="90" Content="Title" Grid.Column="2" />
                    <sdk:Label Height="19" HorizontalAlignment="Left" Margin="18,10,0,8" Name="lblKPIName" VerticalAlignment="Center" Width="70" Content="Name" />
                    <sdk:Label Grid.Row="1" Height="18" HorizontalAlignment="Left" Margin="18,10,0,8" Name="lblKPIDesc" VerticalAlignment="Center" Width="84" Content="Description" />
                    <sdk:Label Grid.Row="2" HorizontalAlignment="Left" Margin="18,13,0,8" Name="lblKPICol" Width="84" Content="Column" VerticalAlignment="Center" />
                    <sdk:Label Grid.Column="2" Grid.Row="2" Height="14" HorizontalAlignment="Left" Margin="20,13,0,10" Name="lblKPISearch" VerticalAlignment="Center" Width="86" Content="Search" />
                    <sdk:Label Grid.Row="3" Height="15" HorizontalAlignment="Left" Margin="18,11,0,9" Name="lblKPICalc" VerticalAlignment="Center" Width="86" Content="Calculation" />
                    <RadioButton Content="Sum" Grid.Column="1" Grid.Row="3" Height="22" HorizontalAlignment="Left" Margin="4,7,0,0" Name="rdSum" VerticalAlignment="Center" Width="198" TabIndex="25" />
                    <RadioButton Content="Count" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="3" Height="23" HorizontalAlignment="Left" Margin="18,7,0,0" Name="rdCount" VerticalAlignment="Center" Width="194" Checked="rdCount_Checked" TabIndex="26" />
                    <RadioButton Content="Minimum" Grid.Column="1" Grid.Row="4" Height="23" HorizontalAlignment="Left" Margin="4,11,0,0" Name="rdMinimum" VerticalAlignment="Center" Width="194" TabIndex="27" />
                    <RadioButton Content="Maximum" Grid.Column="2" Grid.ColumnSpan="2" Grid.Row="4" Height="22" HorizontalAlignment="Left" Margin="18,12,0,2" Name="rdMaximum" VerticalAlignment="Center" Width="238" TabIndex="28" />
                    <TextBox Grid.Column="3" Height="23" HorizontalAlignment="Left" Margin="3,6,0,0" Name="txtSearchKey" VerticalAlignment="Center" Width="201" TabIndex="21" />
                    <TextBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="4,3,0,0" Name="txtKPIDesc" VerticalAlignment="Center" Width="517" TabIndex="22" />
                    <my:VComboBox Grid.Column="1" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="4,5,0,0" x:Name="cmbKPICol" VerticalAlignment="Center" Width="201" TabIndex="23" />
                    <my:VComboBox Grid.Column="3" Grid.Row="2" Height="23" HorizontalAlignment="Left" Margin="3,6,0,0" x:Name="cmbKPISearch" VerticalAlignment="Center" Width="201" TabIndex="24" />
                    <TextBox Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="4,6,0,0" Name="txtKPIName" VerticalAlignment="Center" Width="202" TabIndex="20" />
                    <Button Height="35" HorizontalAlignment="Right" Margin="0,0,67,0" Name="btnKPICancel" VerticalAlignment="Bottom" Width="35" Grid.Row="5" Grid.Column="3" Click="btnKPICancel_Click">
                        <Image Source="/VAdvantage;component/Images/cancel_up.png" Stretch="Fill" />
                    </Button>
                    <Button Height="35" HorizontalAlignment="Right" Margin="0,0,26,0" Name="btnKPIOK" VerticalAlignment="Bottom" Width="35" Grid.Row="5" Grid.Column="3" Click="btnKPIOK_Click">
                        <Image Source="/VAdvantage;component/Images/right_up.png" Stretch="Fill" />
                    </Button>
                </Grid>
            </sdk:TabItem>

            <sdk:TabItem Header="KPI Access" Name="tabItem3">
                <Grid Name="kpiAccessGrid" Background="Transparent">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="48" />
                        <ColumnDefinition Width="124*" />
                        <ColumnDefinition Width="188*" />
                        <ColumnDefinition Width="150*" />
                        <ColumnDefinition Width="157*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="25*" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="35" />
                        <RowDefinition Height="179*" />
                    </Grid.RowDefinitions>
                    <RadioButton Content="Personal" Grid.Column="1" Grid.Row="1" Height="19" HorizontalAlignment="Left" Margin="9,7,0,0" Name="rdPersonal1" VerticalAlignment="Top" Width="99" GroupName="Always" IsChecked="True" Checked="rdPersonal1_Checked" />
                    <RadioButton Content="Selected User" Grid.Column="2" Grid.Row="1" Height="24" HorizontalAlignment="Left" Margin="10,7,0,0" Name="rdUser1" VerticalAlignment="Top" Width="169" Checked="rdUser_Checked" TabIndex="29" />
                    <RadioButton Content="Selected Role" Grid.Column="3" Grid.Row="1" Height="22" HorizontalAlignment="Left" Margin="8,7,0,0" Name="rdRole1" VerticalAlignment="Top" Width="272" Grid.ColumnSpan="2" Checked="rdRole_Checked" TabIndex="30" />
                    <my:VComboBox Grid.Column="2" Grid.Row="3" Height="23" Margin="2" x:Name="cmbUser1" VerticalAlignment="Top" TabIndex="32" />
                    <my:VComboBox Grid.Column="2" Grid.Row="2" Height="23" Margin="2" x:Name="cmbKPI" VerticalAlignment="Top" SelectionChanged="cmbKPI_SelectionChanged" TabIndex="31" />
                    <my:VComboBox Grid.Column="2" Grid.Row="4" Height="23" Margin="2" x:Name="cmbRole1" VerticalAlignment="Top" TabIndex="34" />
                    <sdk:Label Grid.Column="1" Grid.Row="2" Height="20" HorizontalAlignment="Left" Margin="9,2,0,0" Name="lblKPI" VerticalAlignment="Top" Width="97" Content="KPI" />
                    <sdk:Label Grid.Column="1" Grid.Row="4" Height="19" HorizontalAlignment="Left" Margin="9,2,0,0" Name="lblRole1" VerticalAlignment="Top" Width="90" Content="Role" />
                    <sdk:Label Grid.Column="1" Grid.Row="3" Height="21" HorizontalAlignment="Left" Margin="9,2,0,0" Name="lblUser1" VerticalAlignment="Top" Width="101" Content="User" />
                    <sdk:DataGrid AutoGenerateColumns="False" Background="Silver" Grid.ColumnSpan="4" HorizontalAlignment="Stretch" Margin="9,0,6,6" Name="vgridKPIAcess" VerticalAlignment="Stretch" Grid.Row="5" Grid.Column="1" />
                    <Button Grid.Column="3" Grid.Row="4" Height="25" Width="25" Margin="13,3,110,0" Name="bAddKPI1" VerticalAlignment="Top" Click="bAddKPI_Click" TabIndex="35">
                        <Image x:Name="AddImage3" Source="/VAdvantage;component/Images/save.png"></Image>
                    </Button>
                    <Button Height="25" Width="25" Margin="13,3,110,0" Name="bAddKPI" VerticalAlignment="Top" Grid.Column="3" Grid.Row="3" Click="bAddKPI_Click" TabIndex="33">
                        <Image x:Name="AddImage4" Stretch="Fill"  Source="/VAdvantage;component/Images/save.png"></Image>
                    </Button>
                </Grid>
            </sdk:TabItem>
        </my:VTabControl>
        <my:VStatusBar x:Name="lblStatusBar" Grid.ColumnSpan="2" Margin="-1,0,1,11" Height="30" VerticalAlignment="Bottom" />

        <ListBox Name="lstQuery" Grid.Column="1" Margin="0,31,0,45" HorizontalContentAlignment="Stretch" Background="Transparent" SelectionChanged="lstQuery_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Loaded="Grid_Loaded" HorizontalAlignment="Stretch">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding}" MinWidth="150" HorizontalAlignment="Stretch"/> 
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
            
        </ListBox>

        <my:VLabel Grid.Column="1" Height="18" HorizontalAlignment="Left" Margin="0,13,0,0" x:Name="vlblRecent" VerticalAlignment="Top" Width="120" Content="Recent Records" FontStyle="Italic" />
        <ListBox Margin="0,31,0,69" Name="lstFrames" Grid.Column="1" Visibility="Collapsed" SelectionChanged="lstFrames_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid >
                        <TextBlock Text="{Binding}" />
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Button Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="61,364,0,0" Name="btnRemoveFrame" VerticalAlignment="Top" Width="58" Visibility="Collapsed" Click="btnRemoveFrame_Click">
            <Image x:Name="AddImage" Source="/VAdvantage;component/Images/RemoveItem.png"></Image>
        </Button>
        <Button Grid.Column="1" Height="23" HorizontalAlignment="Left" Margin="2,364,0,0" Name="btnAddNew" VerticalAlignment="Top" Width="58" Click="btnAddNew_Click" Visibility="Collapsed">
            <Image x:Name="AddImage6" Source="/VAdvantage;component/Images/AddNew.png"></Image>
        </Button>
        <ListBox Height="332" Margin="0,31,0,0" Name="lstKPI" VerticalAlignment="Top" Visibility="Collapsed" Grid.Column="1" SelectionChanged="lstKPI_SelectionChanged">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <TextBlock Text="{Binding}" />
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</controls:ChildWindow>